package com.example.springevent;

import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;

/**
 * @author : yx-0176
 * @description
 * @date : 2021/7/9
 */
@Component
public class AnnotationRegisterListener {

    /**
     * 注册监听实现方法
     * @param userRegisterEvent 用户注册事件
     */
    @EventListener
    public void sendEmail(UserRegisterEvent userRegisterEvent)
    {
        //获取注册用户对象
        String user = userRegisterEvent.getUser();
        System.out.println(user);
    }

}
